package com.eight.cloud.payment.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eight.cloud.mybatisplus.entity.TenantDataScopeEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * 子商户支付订单信息
 *
 * @ClassName: SubPayOrderEntity
 * @Author TXC
 * @Date 2025-01-07 17:22
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("sys_payment_sub_pay_order")
public class SubPayOrderEntity extends TenantDataScopeEntity<SubPayOrderEntity> {

    private static final long serialVersionUID = 1L;

    /**
     * 平台订单流水号
     */
    @TableField("transaction_id")
    private String transactionId;

    /**
     * 商户号
     */
    @TableField("merchant_id")
    private String merchantId;

    /**
     * 子商户订单编号
     */
    @TableField("sub_order_id")
    private String subOrderId;

    /**
     * 子商户appid
     */
    @TableField("appid")
    private String appid;

    /**
     * 子商户订单总金额 单位为分
     */
    @TableField("total")
    private Long total;

    /**
     * 支付方式
     */
    @TableField("trade_type")
    private String tradeType;

    /**
     * 支付平台类型
     */
    @TableField("pay_channel")
    private String payChannel;

    @Override
    public Serializable pkVal() {
        return null;
    }

    @Getter
    public enum PayStatusEnum {
        UNPAID(0, "未支付"),
        PAID(1, "已支付"),
        REFUND(2, "已退款"),
        CLOSE(3, "已关闭");
        private final Integer value;
        private final String name;
        PayStatusEnum(Integer value, String name) {
            this.value = value;
            this.name = name;
        }
    }
}
